/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: 06.06.12
 * Time: 15:02
 * To change this template use File | Settings | File Templates.
 */
package zakladki.AS3 {
import mx.controls.CheckBox;
import mx.controls.ComboBox;
import mx.controls.NumericStepper;

public class VehicleControls {

    private var _vehicleTypeCombo:ComboBox;
    private var _vehicleAgeCombo:ComboBox;
    private var _fuelTypeCombo:ComboBox;
    private var _passengerFreqCombo:ComboBox;
    private var _weekDistanceStepper:NumericStepper;
    private var _fuelConsumptionStepper:NumericStepper;
    private var _acEnabledCheckBox:CheckBox;

    public function VehicleControls(vehicleTypeCombo:ComboBox, vehicleAgeCombo:ComboBox, fuelTypeCombo:ComboBox, passengerFreqCombo:ComboBox, weekDistanceStepper:NumericStepper, fuelConsumptionStepper:NumericStepper, acEnabledCheckBox:CheckBox) {
        _vehicleTypeCombo = vehicleTypeCombo;
        _vehicleAgeCombo = vehicleAgeCombo;
        _fuelTypeCombo = fuelTypeCombo;
        _passengerFreqCombo = passengerFreqCombo;
        _weekDistanceStepper = weekDistanceStepper;
        _fuelConsumptionStepper = fuelConsumptionStepper;
        _acEnabledCheckBox = acEnabledCheckBox;
    }

    public function changeViewFromParameters(data:VehicleSelectedData):void{
        _vehicleTypeCombo.selectedItem.value = data.vehicleType;
        _vehicleAgeCombo.selectedItem.value = data.age;
        _fuelTypeCombo.selectedItem.value = data.fuelType;
        _passengerFreqCombo.selectedItem.value = data.passengerFreq;
        _weekDistanceStepper.value = data.distancePerWeek;
        _fuelConsumptionStepper.value = data.fuelConsumption;
        _acEnabledCheckBox.selected = data.acEnabled;
    }

    public function get vehicleTypeCombo():ComboBox {
        return _vehicleTypeCombo;
    }

    public function set vehicleTypeCombo(value:ComboBox):void {
        _vehicleTypeCombo = value;
    }

    public function get vehicleAgeCombo():ComboBox {
        return _vehicleAgeCombo;
    }

    public function set vehicleAgeCombo(value:ComboBox):void {
        _vehicleAgeCombo = value;
    }

    public function get fuelTypeCombo():ComboBox {
        return _fuelTypeCombo;
    }

    public function set fuelTypeCombo(value:ComboBox):void {
        _fuelTypeCombo = value;
    }

    public function get passengerFreqCombo():ComboBox {
        return _passengerFreqCombo;
    }

    public function set passengerFreqCombo(value:ComboBox):void {
        _passengerFreqCombo = value;
    }

    public function get weekDistanceStepper():NumericStepper {
        return _weekDistanceStepper;
    }

    public function set weekDistanceStepper(value:NumericStepper):void {
        _weekDistanceStepper = value;
    }

    public function get fuelConsumptionStepper():NumericStepper {
        return _fuelConsumptionStepper;
    }

    public function set fuelConsumptionStepper(value:NumericStepper):void {
        _fuelConsumptionStepper = value;
    }

    public function get acEnabledCheckBox():CheckBox {
        return _acEnabledCheckBox;
    }

    public function set acEnabledCheckBox(value:CheckBox):void {
        _acEnabledCheckBox = value;
    }
}
}
